//index.js
//获取应用实例
const app = getApp();

Page({
  data: {
    classfyList: [],
    inputValue: "",
    carousels: [
      "../../static/image/carousel01.png",
      "../../static/image/carousel02.png"
    ],
    icons: [
      "../../static/image/icon1.png",
      "../../static/image/icon2.png",
      "../../static/image/icon3.png",
      '../../static/image/icon4.png',
      '../../static/image/icon5.png',
    ],
    otherpage: [
      { title: '最热好券', path: '', color: 'linear-gradient(-29deg, #fe6080 0%,#fc9fa9 100%),linear-gradient(#273a50, #273a50)',width:'38rpx',height:'50rpx' },
      { title: '9.9包邮', path: '/freepostage', color: 'linear-gradient(-29deg, #fb873a 0%, #feca91 100%),linear-gradient(#273a50, #273a50)', width: '47rpx', height: '44rpx' },
      { title: '20元封顶', path: '', color: 'linear-gradient(-29deg, #bc71fb 0%, #e8c7fe 100%),linear-gradient(#273a50, #273a50)', width: '46rpx', height: '47rpx' },
      { title: '精选神券', path: '', color: 'linear-gradient(0deg, #59d493 0%, #94e39b 100%),linear-gradient(#273a50, #273a50)', width: '45rpx', height: '45rpx'},
      { title: '所有分类', path: '/category', color: 'linear-gradient(-29deg, #4cc4fd 0%, #8ccdfd 100%),linear-gradient(#273a50, #273a50)', width: '45rpx', height: '45rpx' },
    ],
    tabdatas: ['综合', '销量', '最新','价格'],
    tabbox: ['第1页', '第2页', '第3页','第4页'],
    isShow:0,
    productList:[1,2,3,4]
  },
 
  onLoad:function () {    
    // for (let i = 0; i < this.data.tabdatas.length; i++) {
    //   if (i=0) {
    //     this.setData({isShow:''});
    //   }else{
    //     this.setData({ isShow: 'none' });
    //   }
    // }
    console.log(this.data.tabdatas.length);

  },
  searchKey: function(e) {
    this.setData({ inputValue: e.detail.value });
  },
  clickMe: function() {
    console.log(this.data.inputValue);
  },
  tofreePage:function(e){
    var id = null;
    wx.navigateTo({
      url: "../freepostage/freepostage?id="+id,
      success: function(res) {
        // success
        console.log("success");
      },
      fail: function() {
        // fail
        console.log("fail");
      },
      complete: function() {
        // complete
        console.log("complete");
      }
    });
  },
  showBox:function(e){
    console.log(e.currentTarget.id);
    this.setData({ isShow: e.currentTarget.id });
  },
  toShowDetail:function(){
    var id = null;
    wx.navigateTo({
      url: '../productdetail/productdetail?id='+id,
    })
  }




}); 


